﻿using System.Configuration;
using UtfprLibrary.Exceptions;
using System;

namespace UtfprLibrary.Configurations {
    /// <summary>
    /// TODO
    /// </summary>
    public class UtfprSectionBase : ConfigurationSection {
        #region Properties

        /// <summary>
        /// TODO
        /// </summary>
        /// <exception cref="UtfprLibrary.Exceptions.UtfprConfigurationsException">Thrown when an exception occurs.</exception>
        [ConfigurationProperty("xmlns", IsRequired = true)]
        public string Xmlns {
            get { 
                try {
                    return (string)this["xmlns"];
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not get 'xmlns' value.", ex);
                }
            }
            set { 
                try {
                    this["xmlns"] = value;
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not set 'xmlns' value.", ex);
                }    
            }
        }
        
        /// <summary>
        /// TODO
        /// </summary>
        /// <exception cref="UtfprLibrary.Exceptions.UtfprConfigurationsException">Thrown when an exception occurs.</exception>
        [ConfigurationProperty("xsi:schemaLocation", IsRequired = true)]
        public string Xsi {
            get {
                try {
                    return (string)this["xsi:schemaLocation"];
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not get 'xsi:schemaLocation' value.", ex);
                }
            }
            set {
                try {
                    this["xsi:schemaLocation"] = value;
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not set 'xsi:schemaLocation' value.", ex);
                }
            }
        }
        
        /// <summary>
        /// TODO
        /// </summary>
        /// <exception cref="UtfprLibrary.Exceptions.UtfprConfigurationsException">Thrown when an exception occurs.</exception>
        [ConfigurationProperty("xmlns:xsi", IsRequired = true)]
        public string XmlnsXsi {
            get {
                try {
                    return (string)this["xmlns:xsi"];
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not get 'xmlns:xsi' value.", ex);
                }
            }
            set {
                try {
                    this["xmlns:xsi"] = value;
                } catch (Exception ex) {
                    throw new UtfprConfigurationsException("Could not set 'xmlns:xsi' value.", ex);
                }
            }
        }               

        #endregion
    }
}
